﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

namespace XuanXiang.Infrastructure.EFCore.MySql
{
    public partial class xuanxiangdbContext : DbContext
    {
        public xuanxiangdbContext()
        {
        }

        public xuanxiangdbContext(DbContextOptions<xuanxiangdbContext> options)
            : base(options)
        {
        }

        public virtual DbSet<Car> Cars { get; set; } = null!;
        public virtual DbSet<Carsdetail> Carsdetails { get; set; } = null!;
        public virtual DbSet<Good> Goods { get; set; } = null!;
        public virtual DbSet<Merchant> Merchants { get; set; } = null!;
        public virtual DbSet<MerchantLoginLog> MerchantLoginLogs { get; set; } = null!;
        public virtual DbSet<Order> Orders { get; set; } = null!;
        public virtual DbSet<OrderDetail> OrderDetails { get; set; } = null!;
        public virtual DbSet<Promote> Promotes { get; set; } = null!;
        public virtual DbSet<Supplier> Suppliers { get; set; } = null!;
        public virtual DbSet<SupplierLoginLog> SupplierLoginLogs { get; set; } = null!;
        public virtual DbSet<SysActionLog> SysActionLogs { get; set; } = null!;
        public virtual DbSet<SysDepartment> SysDepartments { get; set; } = null!;
        public virtual DbSet<SysDepartmentPost> SysDepartmentPosts { get; set; } = null!;
        public virtual DbSet<SysDictionary> SysDictionaries { get; set; } = null!;
        public virtual DbSet<SysError> SysErrors { get; set; } = null!;
        public virtual DbSet<SysLoginLog> SysLoginLogs { get; set; } = null!;
        public virtual DbSet<SysPost> SysPosts { get; set; } = null!;
        public virtual DbSet<SysRight> SysRights { get; set; } = null!;
        public virtual DbSet<SysUser> SysUsers { get; set; } = null!;
        public virtual DbSet<SysUserRight> SysUserRights { get; set; } = null!;

      /*  protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySql("server=localhost;database=xuanxiangdb;uid=root;pwd=123456", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.30-mysql"));
            }
        }*/

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8mb4_0900_ai_ci")
                .HasCharSet("utf8mb4");

            modelBuilder.Entity<Car>(entity =>
            {
                entity.HasKey(e => e.CId)
                    .HasName("PRIMARY");

                entity.ToTable("cars");

                entity.HasComment("购物车表");

                entity.Property(e => e.CId)
                    .HasMaxLength(32)
                    .HasColumnName("C_ID")
                    .HasComment("购物车id");

                entity.Property(e => e.CCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("C_CreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.CLastTime)
                    .HasColumnType("datetime")
                    .HasColumnName("C_LastTime")
                    .HasComment("最后更改时间");

                entity.Property(e => e.CMId)
                    .HasMaxLength(32)
                    .HasColumnName("C_M_ID")
                    .HasComment("商户id");

                entity.Property(e => e.CTotal)
                    .HasColumnName("C_Total")
                    .HasComment("商品数量");
            });

            modelBuilder.Entity<Carsdetail>(entity =>
            {
                entity.HasKey(e => e.CdId)
                    .HasName("PRIMARY");

                entity.ToTable("carsdetails");

                entity.Property(e => e.CdId)
                    .HasMaxLength(32)
                    .HasColumnName("CD_ID")
                    .HasComment("购物车详情id");

                entity.Property(e => e.CdCId)
                    .HasMaxLength(32)
                    .HasColumnName("CD_C_ID")
                    .HasComment("关联购物车id");

                entity.Property(e => e.CdGId)
                    .HasMaxLength(32)
                    .HasColumnName("CD_G_ID")
                    .HasComment("商品id");

                entity.Property(e => e.CdLastTime)
                    .HasColumnType("datetime")
                    .HasColumnName("CD_LastTime")
                    .HasComment("最后添加时间");

                entity.Property(e => e.CdNumber)
                    .HasColumnName("CD_Number")
                    .HasComment("商品数量");
            });

            modelBuilder.Entity<Good>(entity =>
            {
                entity.HasKey(e => e.Gid)
                    .HasName("PRIMARY");

                entity.ToTable("goods");

                entity.HasComment("商品类");

                entity.Property(e => e.Gid)
                    .HasMaxLength(32)
                    .HasColumnName("GID")
                    .HasComment("商品ID");

                entity.Property(e => e.GSid)
                    .HasMaxLength(32)
                    .HasColumnName("G_SID")
                    .HasComment("商品供应商ID");

                entity.Property(e => e.Gbirthday)
                    .HasColumnType("datetime")
                    .HasColumnName("GBirthday")
                    .HasComment("商品生产日期");

                entity.Property(e => e.Gcover)
                    .HasMaxLength(999)
                    .HasColumnName("GCover")
                    .HasComment("商品封面");

                entity.Property(e => e.GcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("GCreateTime")
                    .HasComment("商品创建时间");

                entity.Property(e => e.Gexpiryday)
                    .HasColumnName("GExpiryday")
                    .HasComment("保质期");

                entity.Property(e => e.Gexplain)
                    .HasMaxLength(999)
                    .HasColumnName("GExplain")
                    .HasComment("商品描述");

                entity.Property(e => e.Ginventory)
                    .HasColumnName("GInventory")
                    .HasComment("商品总库存");

                entity.Property(e => e.GisBan)
                    .HasColumnName("GIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.GisPromote)
                    .HasColumnName("GIsPromote")
                    .HasComment("是否参加活动");

                entity.Property(e => e.GisShelve)
                    .HasColumnName("GIsShelve")
                    .HasComment("是否上架");

                entity.Property(e => e.Gloss)
                    .HasColumnName("GLoss")
                    .HasComment("商品消耗");

                entity.Property(e => e.Gname)
                    .HasMaxLength(100)
                    .HasColumnName("GName")
                    .HasComment("商品名称");

                entity.Property(e => e.Gprice)
                    .HasColumnName("GPrice")
                    .HasComment("商品价格");

                entity.Property(e => e.GpromoteBegin)
                    .HasColumnType("datetime")
                    .HasColumnName("GPromoteBegin")
                    .HasComment("商品活动开始时间");

                entity.Property(e => e.GpromoteEnd)
                    .HasColumnType("datetime")
                    .HasColumnName("GPromoteEnd")
                    .HasComment("商品活动结束时间");

                entity.Property(e => e.GpromotePrice)
                    .HasColumnName("GPromotePrice")
                    .HasComment("活动价格");

                entity.Property(e => e.Gsales)
                    .HasColumnName("GSales")
                    .HasComment("商品销量");

                entity.Property(e => e.Gspecs)
                    .HasMaxLength(100)
                    .HasColumnName("GSpecs")
                    .HasComment("商品规格");

                entity.Property(e => e.Gtype)
                    .HasMaxLength(100)
                    .HasColumnName("GType")
                    .HasComment("商品类别");
            });

            modelBuilder.Entity<Merchant>(entity =>
            {
                entity.HasKey(e => e.MId)
                    .HasName("PRIMARY");

                entity.ToTable("merchant");

                entity.HasComment("商户表");

                entity.Property(e => e.MId)
                    .HasMaxLength(32)
                    .HasColumnName("M_ID")
                    .HasComment("商户ID");

                entity.Property(e => e.MAccount)
                    .HasMaxLength(32)
                    .HasColumnName("M_Account")
                    .HasComment("账号");

                entity.Property(e => e.MCancelMoney)
                    .HasColumnName("M_CancelMoney")
                    .HasComment("取消金额");

                entity.Property(e => e.MCancelOrderCount)
                    .HasColumnName("M_CancelOrderCount")
                    .HasComment("取消订单数量");

                entity.Property(e => e.MCompleteOrderCount)
                    .HasColumnName("M_CompleteOrderCount")
                    .HasComment("完成订单数量");

                entity.Property(e => e.MContacts)
                    .HasMaxLength(99)
                    .HasColumnName("M_Contacts")
                    .HasComment("联系人");

                entity.Property(e => e.MCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("M_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.MCurrMoney)
                    .HasColumnName("M_CurrMoney")
                    .HasComment("成交金额");

                entity.Property(e => e.MIsActive)
                    .HasColumnName("M_IsActive")
                    .HasComment("是否激活");

                entity.Property(e => e.MIsBan)
                    .HasColumnName("M_IsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.MMoney)
                    .HasColumnName("M_Money")
                    .HasComment("总金额");

                entity.Property(e => e.MName)
                    .HasMaxLength(32)
                    .HasColumnName("M_Name")
                    .HasComment("商户姓名");

                entity.Property(e => e.MOpenId)
                    .HasMaxLength(50)
                    .HasColumnName("M_OpenID")
                    .HasComment("OpenID");

                entity.Property(e => e.MOrderCount)
                    .HasColumnName("M_OrderCount")
                    .HasComment("订单数");

                entity.Property(e => e.MPassword)
                    .HasMaxLength(32)
                    .HasColumnName("M_Password")
                    .HasComment("密码");

                entity.Property(e => e.MSalt)
                    .HasMaxLength(32)
                    .HasColumnName("M_Salt")
                    .HasComment("盐");
            });

            modelBuilder.Entity<MerchantLoginLog>(entity =>
            {
                entity.HasKey(e => e.MLlid)
                    .HasName("PRIMARY");

                entity.ToTable("merchant_login_logs");

                entity.HasComment("商户登录日志表");

                entity.Property(e => e.MLlid)
                    .HasMaxLength(32)
                    .HasColumnName("M_LLID")
                    .HasComment("商户登录日志ID");

                entity.Property(e => e.MCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("M_CreateTime");

                entity.Property(e => e.MLlcode)
                    .HasMaxLength(32)
                    .HasColumnName("M_LLCode")
                    .HasComment("凭据");

                entity.Property(e => e.MLlip)
                    .HasMaxLength(99)
                    .HasColumnName("M_LLIP")
                    .HasComment("ip");

                entity.Property(e => e.MLlmid)
                    .HasMaxLength(32)
                    .HasColumnName("M_LLMID")
                    .HasComment("商户id");
            });

            modelBuilder.Entity<Order>(entity =>
            {
                entity.HasKey(e => e.Oid)
                    .HasName("PRIMARY");

                entity.ToTable("orders");

                entity.HasComment("订单表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Oid)
                    .HasMaxLength(32)
                    .HasColumnName("OId")
                    .HasComment("订单号");

                entity.Property(e => e.OacceptTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OAcceptTime")
                    .HasComment("接单时间");

                entity.Property(e => e.OcancelTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OCancelTime")
                    .HasComment("取消时间");

                entity.Property(e => e.OcancelType)
                    .HasColumnName("OCancelType")
                    .HasComment("1-商户取消,2-供应商取消");

                entity.Property(e => e.OcompleteTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OCompleteTime")
                    .HasComment("完成时间");

                entity.Property(e => e.OcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OCreateTime")
                    .HasComment("下单时间");

                entity.Property(e => e.OcurrMoney)
                    .HasColumnName("OCurrMoney")
                    .HasComment("实际产生金额");

                entity.Property(e => e.OgoodsNames)
                    .HasMaxLength(999)
                    .HasColumnName("OGoodsNames")
                    .HasComment("商品名称，用逗号隔开");

                entity.Property(e => e.OgoodsTypeCount)
                    .HasColumnName("OGoodsTypeCount")
                    .HasComment("商品种类数量");

                entity.Property(e => e.OisAccept)
                    .HasColumnName("OIsAccept")
                    .HasComment("是否接单----1:未处理;1:已接单;0:已拒绝");

                entity.Property(e => e.OisCancel)
                    .HasColumnName("OIsCancel")
                    .HasComment("是否取消");

                entity.Property(e => e.OisComplete)
                    .HasColumnName("OIsComplete")
                    .HasComment("是否完成");

                entity.Property(e => e.OisDirectly)
                    .HasColumnName("OIsDirectly")
                    .HasComment("是否直营订单");

                entity.Property(e => e.OisReceive)
                    .HasColumnName("OIsReceive")
                    .HasComment("是否收货");

                entity.Property(e => e.OisSend)
                    .HasColumnName("OIsSend")
                    .HasComment("是否收货");

                entity.Property(e => e.Omid)
                    .HasMaxLength(32)
                    .HasColumnName("OMID")
                    .HasComment("商户ID");

                entity.Property(e => e.Omoney)
                    .HasColumnName("OMoney")
                    .HasComment("总金额");

                entity.Property(e => e.OreceiveTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OReceiveTime")
                    .HasComment("收货时间");

                entity.Property(e => e.OsendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OSendTime")
                    .HasComment("发货时间");

                entity.Property(e => e.Osid)
                    .HasMaxLength(32)
                    .HasColumnName("OSID")
                    .HasComment("供应商ID");

                entity.Property(e => e.Ototal)
                    .HasColumnName("OTotal")
                    .HasComment("商品数量");
            });

            modelBuilder.Entity<OrderDetail>(entity =>
            {
                entity.HasKey(e => e.OdId)
                    .HasName("PRIMARY");

                entity.ToTable("order_details");

                entity.UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdId)
                    .HasMaxLength(32)
                    .HasColumnName("OD_ID")
                    .HasComment("订单详情ID");

                entity.Property(e => e.OdBirthday)
                    .HasColumnType("datetime")
                    .HasColumnName("OD_Birthday")
                    .HasComment("商品生产日期");

                entity.Property(e => e.OdCancelTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OD_CancelTime")
                    .HasComment("取消时间");

                entity.Property(e => e.OdCompleteTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OD_CompleteTime")
                    .HasComment("完成时间");

                entity.Property(e => e.OdCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OD_CreateTime")
                    .HasComment("下单时间");

                entity.Property(e => e.OdCurrMoney)
                    .HasColumnName("OD_CurrMoney")
                    .HasComment("实际收货金额");

                entity.Property(e => e.OdCurrNumber)
                    .HasColumnName("OD_CurrNumber")
                    .HasComment("实际收货数量");

                entity.Property(e => e.OdExpiryday)
                    .HasColumnName("OD_Expiryday")
                    .HasComment("商品保质期");

                entity.Property(e => e.OdGid)
                    .HasMaxLength(32)
                    .HasColumnName("OD_GID")
                    .HasComment("商品ID");

                entity.Property(e => e.OdIsCancel)
                    .HasColumnName("OD_IsCancel")
                    .HasComment("是否取消");

                entity.Property(e => e.OdIsComplete)
                    .HasColumnName("OD_IsComplete")
                    .HasComment("是否完成");

                entity.Property(e => e.OdIsDirectly)
                    .HasColumnName("OD_IsDirectly")
                    .HasComment("是否直营商品订单");

                entity.Property(e => e.OdIsPromote)
                    .HasColumnName("OD_IsPromote")
                    .HasComment("是否促销");

                entity.Property(e => e.OdIsReceive)
                    .HasColumnName("OD_IsReceive")
                    .HasComment("是否收货");

                entity.Property(e => e.OdIsSend)
                    .HasColumnName("OD_IsSend")
                    .HasComment("是否发货");

                entity.Property(e => e.OdMid)
                    .HasMaxLength(32)
                    .HasColumnName("OD_MID")
                    .HasComment("商户ID");

                entity.Property(e => e.OdMoney)
                    .HasColumnName("OD_Money")
                    .HasComment("总价");

                entity.Property(e => e.OdName)
                    .HasMaxLength(50)
                    .HasColumnName("OD_Name")
                    .HasComment("商品名称");

                entity.Property(e => e.OdNumber)
                    .HasColumnName("OD_Number")
                    .HasComment("数量");

                entity.Property(e => e.OdOid)
                    .HasMaxLength(32)
                    .HasColumnName("OD_OID")
                    .HasComment("订单ID");

                entity.Property(e => e.OdPhoto)
                    .HasMaxLength(255)
                    .HasColumnName("OD_Photo")
                    .HasComment("商品图片");

                entity.Property(e => e.OdPrice)
                    .HasColumnName("OD_Price")
                    .HasComment("价格");

                entity.Property(e => e.OdPromotePrice)
                    .HasColumnName("OD_PromotePrice")
                    .HasComment("促销价格");

                entity.Property(e => e.OdReceiveTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OD_ReceiveTime")
                    .HasComment("收货时间");

                entity.Property(e => e.OdSendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("OD_SendTime")
                    .HasComment("发货时间");

                entity.Property(e => e.OdSid)
                    .HasMaxLength(32)
                    .HasColumnName("OD_SID")
                    .HasComment("供应商ID");

                entity.Property(e => e.OdSpecs)
                    .HasMaxLength(255)
                    .HasColumnName("OD_Specs")
                    .HasComment("规格");

                entity.Property(e => e.OdType)
                    .HasMaxLength(255)
                    .HasColumnName("OD_Type")
                    .HasComment("商品类别");
            });

            modelBuilder.Entity<Promote>(entity =>
            {
                entity.HasKey(e => e.Pid)
                    .HasName("PRIMARY");

                entity.ToTable("promote");

                entity.HasComment("促销活动表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Pid)
                    .HasMaxLength(32)
                    .HasColumnName("PID")
                    .HasComment("活动ID");

                entity.Property(e => e.PbeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("PBeginTime")
                    .HasComment("活动开始时间");

                entity.Property(e => e.PcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("PCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.PendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("PEndTime")
                    .HasComment("活动结束时间");

                entity.Property(e => e.Pgid)
                    .HasMaxLength(32)
                    .HasColumnName("PGID")
                    .HasComment("商品ID");

                entity.Property(e => e.Pgname)
                    .HasMaxLength(99)
                    .HasColumnName("PGName")
                    .HasComment("商品名称");

                entity.Property(e => e.PinitPrice)
                    .HasColumnName("PInitPrice")
                    .HasComment("原价");

                entity.Property(e => e.PpromotePrice).HasComment("活动价");

                entity.Property(e => e.Psid)
                    .HasMaxLength(32)
                    .HasColumnName("PSID")
                    .HasComment("供应商");
            });

            modelBuilder.Entity<Supplier>(entity =>
            {
                entity.HasKey(e => e.Sid)
                    .HasName("PRIMARY");

                entity.ToTable("supplier");

                entity.HasComment("供应商表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Sid)
                    .HasMaxLength(32)
                    .HasColumnName("SID")
                    .HasComment("供应商ID");

                entity.Property(e => e.Saccount)
                    .HasMaxLength(32)
                    .HasColumnName("SAccount")
                    .HasComment("供应商账号");

                entity.Property(e => e.Saddress)
                    .HasMaxLength(999)
                    .HasColumnName("SAddress")
                    .HasComment("供应商地址");

                entity.Property(e => e.Sannouncement)
                    .HasMaxLength(999)
                    .HasColumnName("SAnnouncement")
                    .HasComment("供应商公告");

                entity.Property(e => e.ScancelMoney)
                    .HasColumnName("SCancelMoney")
                    .HasComment("取消金额");

                entity.Property(e => e.ScancelOrderCount)
                    .HasColumnName("SCancelOrderCount")
                    .HasComment("取消订单数");

                entity.Property(e => e.ScompleteOrderCount)
                    .HasColumnName("SCompleteOrderCount")
                    .HasComment("完成订单数");

                entity.Property(e => e.ScreatTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SCreatTime")
                    .HasComment("创建时间");

                entity.Property(e => e.ScurrMoney)
                    .HasColumnName("SCurrMoney")
                    .HasComment("成交金额");

                entity.Property(e => e.SenterpriseName)
                    .HasMaxLength(99)
                    .HasColumnName("SEnterpriseName")
                    .HasComment("企业名称");

                entity.Property(e => e.SisActive)
                    .HasColumnName("SIsActive")
                    .HasComment("是否激活");

                entity.Property(e => e.SisBan)
                    .HasColumnName("SIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Slogo)
                    .HasMaxLength(999)
                    .HasColumnName("SLogo")
                    .HasComment("企业logo");

                entity.Property(e => e.Smoney)
                    .HasColumnName("SMoney")
                    .HasComment("订单总金额");

                entity.Property(e => e.Sname)
                    .HasMaxLength(32)
                    .HasColumnName("SName")
                    .HasComment("供应商名字");

                entity.Property(e => e.SopenId)
                    .HasMaxLength(50)
                    .HasColumnName("SOpenID")
                    .HasComment("微信ID");

                entity.Property(e => e.SorderCount)
                    .HasColumnName("SOrderCount")
                    .HasComment("订单数");

                entity.Property(e => e.Spassword)
                    .HasMaxLength(32)
                    .HasColumnName("SPassword")
                    .HasComment("供应商密码");

                entity.Property(e => e.Sphoto)
                    .HasMaxLength(999)
                    .HasColumnName("SPhoto")
                    .HasComment("企业照片");

                entity.Property(e => e.Squalification)
                    .HasMaxLength(999)
                    .HasColumnName("SQualification")
                    .HasComment("企业资质");

                entity.Property(e => e.Ssalt)
                    .HasMaxLength(32)
                    .HasComment("盐");

                entity.Property(e => e.Stype)
                    .HasMaxLength(255)
                    .HasColumnName("SType")
                    .HasComment("经营类型");
            });

            modelBuilder.Entity<SupplierLoginLog>(entity =>
            {
                entity.HasKey(e => e.SLlid)
                    .HasName("PRIMARY");

                entity.ToTable("supplier_login_logs");

                entity.HasComment("供应商登录日志表");

                entity.Property(e => e.SLlid)
                    .HasMaxLength(32)
                    .HasColumnName("S_LLID")
                    .HasComment("供应商登录日志ID");

                entity.Property(e => e.SCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("S_CreateTime");

                entity.Property(e => e.SLlcode)
                    .HasMaxLength(32)
                    .HasColumnName("S_LLCode")
                    .HasComment("凭据");

                entity.Property(e => e.SLlip)
                    .HasMaxLength(999)
                    .HasColumnName("S_LLIP")
                    .HasComment("ip");

                entity.Property(e => e.SLlsid)
                    .HasMaxLength(32)
                    .HasColumnName("S_LLSID")
                    .HasComment("供应商id");
            });

            modelBuilder.Entity<SysActionLog>(entity =>
            {
                entity.HasKey(e => e.AlId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_action_log");

                entity.HasComment("系统操作日志表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlId)
                    .HasMaxLength(32)
                    .HasColumnName("AL_ID")
                    .HasComment("操作日志唯一标识");

                entity.Property(e => e.AlAction)
                    .HasMaxLength(100)
                    .HasColumnName("AL_Action")
                    .HasComment("操作动作");

                entity.Property(e => e.AlCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("AL_CreateTime")
                    .HasComment("操作创建时间");

                entity.Property(e => e.AlDesc)
                    .HasMaxLength(255)
                    .HasColumnName("AL_Desc")
                    .HasComment("操作描述");

                entity.Property(e => e.AlGroup)
                    .HasMaxLength(100)
                    .HasColumnName("AL_Group")
                    .HasComment("操作分组");

                entity.Property(e => e.AlIp)
                    .HasMaxLength(99)
                    .HasColumnName("AL_IP")
                    .HasComment("操作IP");

                entity.Property(e => e.AlMethod)
                    .HasMaxLength(20)
                    .HasColumnName("AL_Method")
                    .HasComment("请求方法");

                entity.Property(e => e.AlParams)
                    .HasMaxLength(999)
                    .HasColumnName("AL_Params")
                    .HasComment("请求参数");

                entity.Property(e => e.AlUId)
                    .HasMaxLength(32)
                    .HasColumnName("AL_U_ID")
                    .HasComment("关联用户标识");

                entity.Property(e => e.AlUrl)
                    .HasMaxLength(99)
                    .HasColumnName("AL_Url")
                    .HasComment("操作URL");
            });

            modelBuilder.Entity<SysDepartment>(entity =>
            {
                entity.HasKey(e => e.DId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_department");

                entity.HasComment("部门表");

                entity.Property(e => e.DId)
                    .HasMaxLength(32)
                    .HasColumnName("D_ID")
                    .HasComment("部门ID");

                entity.Property(e => e.DCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("D_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.DExplain)
                    .HasMaxLength(999)
                    .HasColumnName("D_Explain")
                    .HasComment("描述");

                entity.Property(e => e.DIcon)
                    .HasMaxLength(225)
                    .HasColumnName("D_Icon")
                    .HasComment("部门图标");

                entity.Property(e => e.DIsBan)
                    .HasColumnName("D_IsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.DLv)
                    .HasColumnName("D_Lv")
                    .HasComment("部门等级");

                entity.Property(e => e.DName)
                    .HasMaxLength(50)
                    .HasColumnName("D_Name")
                    .HasComment("部门名称");

                entity.Property(e => e.DParent)
                    .HasMaxLength(32)
                    .HasColumnName("D_Parent")
                    .HasComment("父级部门ID");
            });

            modelBuilder.Entity<SysDepartmentPost>(entity =>
            {
                entity.HasKey(e => e.DpId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_department_post");

                entity.HasComment("部门岗位关联表");

                entity.Property(e => e.DpId)
                    .HasMaxLength(32)
                    .HasColumnName("DP_ID")
                    .HasComment("关联ID");

                entity.Property(e => e.DpCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("DP_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.DpDId)
                    .HasMaxLength(32)
                    .HasColumnName("DP_D_ID")
                    .HasComment("部门id");

                entity.Property(e => e.DpPId)
                    .HasMaxLength(32)
                    .HasColumnName("DP_P_ID")
                    .HasComment("岗位id");
            });

            modelBuilder.Entity<SysDictionary>(entity =>
            {
                entity.HasKey(e => e.Did)
                    .HasName("PRIMARY");

                entity.ToTable("sys_dictionary");

                entity.HasComment("字典类");

                entity.Property(e => e.Did)
                    .HasMaxLength(32)
                    .HasColumnName("DID")
                    .HasComment("字典ID");

                entity.Property(e => e.DcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("DCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Dexplain)
                    .HasMaxLength(999)
                    .HasColumnName("DExplain")
                    .HasComment("描述");

                entity.Property(e => e.Dicon)
                    .HasMaxLength(255)
                    .HasColumnName("DIcon")
                    .HasComment("图标");

                entity.Property(e => e.DisBan)
                    .HasColumnName("DIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.DisType)
                    .HasColumnName("DIsType")
                    .HasComment("是否是类别");

                entity.Property(e => e.Dname)
                    .HasMaxLength(100)
                    .HasColumnName("DName")
                    .HasComment("字典名称");

                entity.Property(e => e.Dno)
                    .HasColumnName("DNo")
                    .HasComment("排序序号");

                entity.Property(e => e.DparentId)
                    .HasMaxLength(32)
                    .HasColumnName("DParentId")
                    .HasComment("上级ID");

                entity.Property(e => e.Dsid)
                    .HasMaxLength(32)
                    .HasColumnName("DSID")
                    .HasComment("供应商id");

                entity.Property(e => e.Dvalue)
                    .HasMaxLength(255)
                    .HasColumnName("DValue")
                    .HasComment("值");
            });

            modelBuilder.Entity<SysError>(entity =>
            {
                entity.HasKey(e => e.EId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_error");

                entity.HasComment("系统错误日志表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EId)
                    .HasMaxLength(32)
                    .HasColumnName("E_ID")
                    .HasComment("错误日志唯一标识");

                entity.Property(e => e.ECreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("E_CreateTime")
                    .HasComment("错误创建时间");

                entity.Property(e => e.EMessage)
                    .HasMaxLength(999)
                    .HasColumnName("E_Message")
                    .HasComment("错误消息");

                entity.Property(e => e.EMethod)
                    .HasMaxLength(20)
                    .HasColumnName("E_Method")
                    .HasComment("请求方法");

                entity.Property(e => e.EParams)
                    .HasColumnType("text")
                    .HasColumnName("E_Params")
                    .HasComment("请求参数");

                entity.Property(e => e.EUrl)
                    .HasMaxLength(99)
                    .HasColumnName("E_Url")
                    .HasComment("请求URL");
            });

            modelBuilder.Entity<SysLoginLog>(entity =>
            {
                entity.HasKey(e => e.Llid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_login_log");

                entity.HasComment("系统登录日志表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Llid)
                    .HasMaxLength(32)
                    .HasColumnName("LLID")
                    .HasComment("登录日志记录唯一标识");

                entity.Property(e => e.Llcode)
                    .HasMaxLength(32)
                    .HasColumnName("LLCode")
                    .HasComment("登录相关编码");

                entity.Property(e => e.LlcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("LLCreateTime")
                    .HasComment("登录操作创建时间");

                entity.Property(e => e.Llresult)
                    .HasColumnName("LLResult")
                    .HasComment("登录结果");

                entity.Property(e => e.Lluid)
                    .HasMaxLength(32)
                    .HasColumnName("LLUID")
                    .HasComment("关联用户唯一标识");
            });

            modelBuilder.Entity<SysPost>(entity =>
            {
                entity.HasKey(e => e.PId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_post");

                entity.HasComment("岗位表");

                entity.Property(e => e.PId)
                    .HasMaxLength(32)
                    .HasColumnName("P_ID")
                    .HasComment("岗位ID");

                entity.Property(e => e.PCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("P_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.PExplain)
                    .HasMaxLength(225)
                    .HasColumnName("P_Explain")
                    .HasComment("描述");

                entity.Property(e => e.PIcon)
                    .HasMaxLength(100)
                    .HasColumnName("P_Icon")
                    .HasComment("岗位图标");

                entity.Property(e => e.PIsBan)
                    .HasColumnName("P_IsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.PLv)
                    .HasColumnName("P_Lv")
                    .HasComment("岗位等级");

                entity.Property(e => e.PName)
                    .HasMaxLength(32)
                    .HasColumnName("P_Name")
                    .HasComment("岗位名称");
            });

            modelBuilder.Entity<SysRight>(entity =>
            {
                entity.HasKey(e => e.RId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_right");

                entity.HasComment("权限表");

                entity.Property(e => e.RId)
                    .HasMaxLength(32)
                    .HasColumnName("R_ID");

                entity.Property(e => e.RCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("R_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.RDesc)
                    .HasMaxLength(255)
                    .HasColumnName("R_Desc")
                    .HasComment("描述");

                entity.Property(e => e.RIcon)
                    .HasMaxLength(100)
                    .HasColumnName("R_Icon")
                    .HasComment("权限图标");

                entity.Property(e => e.RIsBan)
                    .HasColumnName("R_IsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.RIsMenu)
                    .HasColumnName("R_IsMenu")
                    .HasComment("是否是菜单");

                entity.Property(e => e.RName)
                    .HasMaxLength(99)
                    .HasColumnName("R_Name")
                    .HasComment("权限名称");

                entity.Property(e => e.RNo)
                    .HasColumnName("R_No")
                    .HasComment("序号");

                entity.Property(e => e.RParent)
                    .HasMaxLength(32)
                    .HasColumnName("R_Parent")
                    .HasComment("上级权限");

                entity.Property(e => e.RUrl)
                    .HasMaxLength(99)
                    .HasColumnName("R_Url")
                    .HasComment("权限地址");
            });

            modelBuilder.Entity<SysUser>(entity =>
            {
                entity.HasKey(e => e.Uid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_users");

                entity.HasComment("用户信息表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Uid)
                    .HasMaxLength(32)
                    .HasColumnName("UID")
                    .HasComment("主键");

                entity.Property(e => e.Uaccount)
                    .HasMaxLength(11)
                    .HasColumnName("UAccount")
                    .HasComment("用户账号");

                entity.Property(e => e.UcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.UdeptId)
                    .HasMaxLength(32)
                    .HasColumnName("UDeptID")
                    .HasComment("部门id");

                entity.Property(e => e.Ugender)
                    .HasMaxLength(2)
                    .HasColumnName("UGender")
                    .HasComment("用户性别");

                entity.Property(e => e.UisActive)
                    .HasColumnName("UIsActive")
                    .HasComment("是否激活");

                entity.Property(e => e.UisBan)
                    .HasColumnName("UIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Uname)
                    .HasMaxLength(32)
                    .HasColumnName("UName")
                    .HasComment("用户名");

                entity.Property(e => e.Upassword)
                    .HasMaxLength(32)
                    .HasColumnName("UPassword")
                    .HasComment("用户密码");

                entity.Property(e => e.Uphone)
                    .HasMaxLength(11)
                    .HasColumnName("UPhone")
                    .HasComment("用户电话");

                entity.Property(e => e.UpostId)
                    .HasMaxLength(32)
                    .HasColumnName("UPostID")
                    .HasComment("岗位id");

                entity.Property(e => e.Usalt)
                    .HasMaxLength(32)
                    .HasColumnName("USalt")
                    .HasComment("盐值");
            });

            modelBuilder.Entity<SysUserRight>(entity =>
            {
                entity.HasKey(e => e.UrId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_user_right");

                entity.HasComment("权限关联表");

                entity.Property(e => e.UrId)
                    .HasMaxLength(32)
                    .HasColumnName("UR_ID");

                entity.Property(e => e.UrBeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UR_BeginTime")
                    .HasComment("生效时间");

                entity.Property(e => e.UrCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UR_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.UrEndTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UR_EndTime")
                    .HasComment("失效时间");

                entity.Property(e => e.UrRid)
                    .HasMaxLength(32)
                    .HasColumnName("UR_RID")
                    .HasComment("权限ID");

                entity.Property(e => e.UrUid)
                    .HasMaxLength(32)
                    .HasColumnName("UR_UID")
                    .HasComment("用户ID");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
